package models.re.simulatedData;

import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.List;

import models.re.aaa.AAAAlgorithm;
import models.spider.stats.Stopwatch;
import play.Logger;

public class TestPerformances {
	
	private static PrintStream original = System.out;
	private static PrintStream none = new PrintStream(new OutputStream() {
		public void write(int b) {
			//DO NOTHING
		}
	});
	
	public static void perfCurve() {
		List<Integer> nodesDim = Arrays.asList(1,10,10,20,20);
		List<Integer> relsDim = Arrays.asList(3,3,70,35,400);
		for(int i=0;i<nodesDim.size();i++) {
			Logger.info("Generate Data, dims: "+nodesDim.get(i)+" - "+relsDim.get(i));	    	
			SimulatedDataOne.GenerateDatas(nodesDim.get(i),relsDim.get(i));      
			perf();
		}
	}

	public static void perf() {
		Logger.info("Start Graph Construction");
		System.setOut(none);   
		Stopwatch w = new Stopwatch();
		String[] args = {"Simul"};
		try {
			AAAAlgorithm.main(args);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		w.stop();
		System.setOut(original);
		Logger.info("Graph Constructed in: " + w.elapsed()+"ms");
	}

}
